//
//  NSObject+FtFactoy.m
//  Feast
//
//  Created by 胡光健 on 2017/8/29.
//  Copyright © 2017年 mac. All rights reserved.
//

#import "NSObject+FtFactoy.h"

@implementation NSObject (FtFactoy)

-(UILabel *)configWithLabel:(NSString *)text textColor:(UIColor*)color textAlignment:(NSTextAlignment)textAlignment frame:(CGRect)frame font:(UIFont*)font {
    UILabel * label = [[UILabel alloc]init];
    label.frame = frame;
    label.font = font;
    label.textAlignment = textAlignment;
    label.textColor = color;
    label.text = text;
    
    return label;
}

-(UIButton *)configWithButton:(NSString *)title selecteTitle:(NSString*)selecteTitle titleColor:(UIColor *)color selecteTitleColor:(UIColor *)selecteTitleColor frame:(CGRect)frame backGroundImage:(UIImage*)backImage image:(UIImage*)image selecteImage:(UIImage*)selecteImage font:(UIFont*)font {
    
    UIButton * btn = [UIButton buttonWithType:UIButtonTypeCustom];
    btn.frame = frame;
    btn.titleLabel.font = font;
    [btn setTitle:title forState:UIControlStateNormal];
    [btn setTitle:selecteTitle forState:UIControlStateSelected];
    [btn setTitleColor:color forState:UIControlStateNormal];
    [btn setTitleColor:selecteTitleColor forState:UIControlStateSelected];
    [btn setImage:image forState:UIControlStateNormal];
    [btn setImage:selecteImage forState:UIControlStateSelected];
    [btn setBackgroundImage:backImage forState:UIControlStateNormal];
    [btn setBackgroundImage:backImage forState:UIControlStateSelected];
//    [btn addTarget:target action:@selector(action) forControlEvents:UIControlEventTouchUpInside];

    return btn;
}

@end
